import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue')
    },
    {
      path: '/',
      name: 'main',
      component: () => import('../views/MainView.vue'),
      children: [
        {
          path: '/GoodType',
          name: 'GoodType',
          component: () => import('../views/Goods/GoodTypeView.vue')
        },
        {
          path: '/GoodList',
          name: 'GoodList',
          component: () => import('../views/Goods/GoodListView.vue')
        },
        {
          path: '/SuppliercustomerList',
          name: 'SuppliercustomerList',
          component: () => import('../views/Suppliercustomers/SuppliercustomerList.vue')
        },
        {
          path: '/BuyEnter',
          name: 'BuyEnter',
          component: () => import('../views/Procurements/BuyEnterView.vue')
        },
        {
          path: '/BuyList',
          name: 'BuyList',
          component: () => import('../views/Procurements/BuyListViews.vue')
        },
        {
          path: '/BuyReturn',
          name: 'BuyReturn',
          component: () => import('../views/Procurements/BuyReturnView.vue')
        },
        {
          path: '/BuyingRequisition',
          name: 'BuyingRequisition',
          component: () => import('../views/Procurements/BuyingRequisition.vue')
        },
      ]
    }
  ]
})

export default router
